package com.freewater.library.lending.book.presentation.request;

import com.freewater.library.lending.book.application.command.CreateBookInstanceCommand;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

@Data
public class CreateBookInstanceRequest {

    @NotBlank(message = "二维码不能为空")
    @Parameter(description = "二维码")
    private final String qrCode;

    @NotBlank(message = "ISBN不能为空")
    @Parameter(description = "ISBN")
    private final String isbn;

    public CreateBookInstanceCommand toCommand() {
        return new CreateBookInstanceCommand(this.qrCode, this.isbn);
    }
}
